using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using JCTimes.DomainModel.Views;


namespace JCTimes.EFRepository.Mapping
{
    public class V_UsersLogMap : EntityTypeConfiguration<V_UsersLog>
    {
        public V_UsersLogMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.UsersID)
                .HasMaxLength(50);

            this.Property(t => t.UserName)
                .HasMaxLength(50);

            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.RoleName)
                .HasMaxLength(50);

            this.Property(t => t.RoleID)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("V_UsersLog");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.LoginDate).HasColumnName("LoginDate");
            this.Property(t => t.UsersID).HasColumnName("UsersID");
            this.Property(t => t.UserName).HasColumnName("UserName");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.RoleName).HasColumnName("RoleName");
            this.Property(t => t.RoleID).HasColumnName("RoleID");
        }
    }
}
